Trim wasmtime serve's default world#7597
Merged
Merged
Conversation
This commit aims to address a discrepancy in Wasmtime where the world supported by `wasmtime serve` is too large today. This includes WIT interfaces which are not specified in `wasi:http/proxy` such as `wasi:filesystem/types`, aka access to a filesystem. This commit slims down `wasmtime serve` to, by default, only supporting the `wasi:http/proxy` world. Like with `wasmtime run` various CLI flags can be passed to enable more interfaces, however: * `-Scommon` - this enables "common" interfaces such as `wasi:filesystem`, `wasi:sockets`, and `wasi:cli/*`. * `-Snn` - this enables wasi-nn It's expected that more will get extended here over time too. This change is enabled by a third build of the adapter, a "proxy" mode. In this mode most functions are cfg'd to return `ERRNO_NOTSUP` to indicate that the runtime does not support it. Notably this includes the filesystem, arguments, and environment variables. This change is tested by updating all `api_proxy*` tests to use this new adapter which is now required that many previous interfaces are no longer present by default in the proxy world.
elliottt
approved these changes
Nov 29, 2023
Comment on lines
-28
to
-30
| // TODO: this shouldn't be required, but the adapter unconditionally pulls in all of these | ||
| // dependencies. | ||
| preview2::command::add_to_linker(l)?; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit aims to address a discrepancy in Wasmtime where the world supported by
wasmtime serveis too large today. This includes WIT interfaces which are not specified inwasi:http/proxysuch aswasi:filesystem/types, aka access to a filesystem.This commit slims down
wasmtime serveto, by default, only supporting thewasi:http/proxyworld. Like withwasmtime runvarious CLI flags can be passed to enable more interfaces, however:-Scommon- this enables "common" interfaces such aswasi:filesystem,wasi:sockets, andwasi:cli/*.-Snn- this enables wasi-nnIt's expected that more will get extended here over time too.
This change is enabled by a third build of the adapter, a "proxy" mode. In this mode most functions are cfg'd to return
ERRNO_NOTSUPto indicate that the runtime does not support it. Notably this includes the filesystem, arguments, and environment variables.This change is tested by updating all
api_proxy*tests to use this new adapter which is now required that many previous interfaces are no longer present by default in the proxy world.